From: Wei Liu Date: Mon, 6 Aug 2018 10:35:18 +0000 (+0100) Subject: tools/kdd: work around gcc 8.1 bug X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~3446 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=48a70499e6bf0f9742fd2d79cd8db5ec674213e2;p=xen.git tools/kdd: work around gcc 8.1 bug Gcc 8.1 has a bug that causes kdd fail to build. Rewrite the code to work around that bug. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86827 Signed-off-by: Tim Deegan Signed-off-by: Wei Liu Tested-by: Wei Liu Acked-by: Ian Jackson --- diff --git a/tools/debugger/kdd/kdd.c b/tools/debugger/kdd/kdd.c index 5a019a0a0c..fb8c645355 100644 --- a/tools/debugger/kdd/kdd.c +++ b/tools/debugger/kdd/kdd.c @@ -687,11 +687,10 @@ static void kdd_handle_read_ctrl(kdd_state *s) } } else { /* 32-bit control-register space starts at 0x[2]cc, for 84 bytes */ - uint32_t offset = addr; - if (offset > 0x200) - offset -= 0x200; - offset -= 0xcc; - if (offset > sizeof ctrl.c32 || offset + len > sizeof ctrl.c32) { + uint32_t offset = addr - 0xcc; + if (offset > sizeof ctrl.c32) + offset -= 0x2cc; + if (offset > sizeof ctrl.c32 || len > sizeof ctrl.c32 - offset) { KDD_LOG(s, "Request outside of known control space\n"); len = 0; } else {